package org.example.movies.service.impl;



import org.example.movies.dao.CateLogDao;
import org.example.movies.dao.FilmDao;
import org.example.movies.dao.impl.CateLogDaoImpl;
import org.example.movies.dao.impl.FilmDaoImpl;
import org.example.movies.pojo.TCatelog;
import org.example.movies.pojo.TFilm;
import org.example.movies.service.IndexService;
import org.example.movies.utils.IndexData;

import java.util.List;

/**
 * 购物车
 * 查看购物车 查询
 * 添加购物车 增加
 * 修改商品的数量  更新
 * 功能 名称
 */
public class IndexServiceImpl implements IndexService {
    CateLogDao cateLogDao = new CateLogDaoImpl();
    FilmDao filmDao = new FilmDaoImpl();

    /**
     * @return
     */
    @Override
    public IndexData getIndexData() {
        IndexData data = new IndexData();

        List<TCatelog> cateLogs = cateLogDao.selelctCateList();
        List<TFilm> films = filmDao.selectAllFilm();

        data.setCateLogs(cateLogs);
        data.setFilms(films);

        return data;
    }
}

